<div class="layui-card">
    <div class="layui-card-body ">
        <form action=""  class="layui-form">
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <input type="text" name="keywords" value="{$search.keywords|default=''}" class="layui-input" placeholder="文章标题">
                </div>
                <div class="layui-input-inline">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">搜索</button>
                    {if isset($search.keywords)}
                    <a href="javascript:history.go(-1);" class="layui-btn">返回</a>
                    {/if}
                </div>
            </div>
        </form>
        <form action="{:url('post/admin.post/delpost')}" method="post" class="layui-form delete-form " id="cp-form">
            <div class="layui-btn-group">
                <a href="{:url('post/admin.post/addpost')}" class="layui-btn layui-btn-xs">
                    <i class="layui-icon layui-icon-addition"></i>
                    添加文章
                </a>
                <button data-url="{:url('post/admin.post/delpost')}" class="layui-btn layui-btn-xs layui-btn-danger ">
                    <i class="layui-icon">&#xe640;</i>
                    删除文章
                </button>
            </div>
            <table class="layui-table" lay-even lay-skin="line">
                <thead>
                    <tr>
                            <th width="10">
                            <input type="checkbox" class="layui-input"  lay-skin="primary" lay-filter="select-all">
                        </th>
                        <th width="300">标题</th>
                        <th width="120">分类</th>
                        <th width="50">作者</th>
                        <th width="65">点击量</th>
                        <th width="65">评论量</th>
                        <th width="160">
                            <p>关键字/来源</p>
                            <p>摘要/缩略图</p>
                        </th>
                        <th width="160">更新时间</th>
                        <th width="160">发布时间</th>
                        <th width="70">状态</th>
                        <td width="120">查看权限</td>
                        <th width="300">操作</th>
                    </tr>
                </thead>
                <tbody>
                {volist name="postList" id='v'}
                <tr>
                    <td align="center" valign="middle">
                        <input type="checkbox" name="idList[]" class="layui-input" lay-skin="primary" value="{$v.id}">
                    </td>
                    <td>{$v.post_title}</td>
                    <td>
                        <p style="height: 40px;line-height: 40px;overflow: hidden">
                            {volist name='v.category' id='cv'}
                            <span class="layui-badge layui-bg-gray">{$cv.name}</span>
                            {/volist}
                        </p>
                    </td>
                    <td>{$v.user.username|default=''}</td>
                    <td>{$v.post_hits|default=0}</td>
                    <td>{$v.comment_count|default=0}</td>
                    <td>
                        {if $v.post_keywords}
                            <i class="layui-icon layui-icon-ok"></i>
                        {else /}
                        <i class="layui-icon layui-icon-close"></i>
                        {/if}
                        {if $v.post_source}
                        <i class="layui-icon layui-icon-ok"></i>
                        {else /}
                        <i class="layui-icon layui-icon-close"></i>
                        {/if}
                        {if $v.post_excerpt}
                        <i class="layui-icon layui-icon-ok"></i>
                        {else /}
                        <i class="layui-icon layui-icon-close"></i>
                        {/if}
                        {if $v.thumbnail}
                        <i class="layui-icon layui-icon-picture-fine"></i>
                        {else /}
                        <i class="layui-icon layui-icon-close"></i>
                        {/if}
                    </td>
                    <td>{$v.update_time|date="Y-m-d H:i"}</td>
                    <td>{$v.published_time|date="Y-m-d H:i"}</td>
                    <td>
                        {if $v.post_status}
                        <i class="layui-icon layui-icon-ok"></i>
                        {else /}
                        <i class="layui-icon layui-icon-close"></i>
                        {/if}
                        {if $v.is_top}
                        <i class="layui-icon layui-icon-top"></i>
                        {else /}
                        <i class="layui-icon layui-icon-download-circle"></i>
                        {/if}
                        {if $v.recommended}
                        <i class="layui-icon layui-icon-rate-solid"></i>
                        {else /}
                        <i class="layui-icon layui-icon-rate"></i>
                        {/if}
                    </td>
                    <td>
                        <select name="access" id="" lay-filter="LookAccess">
                            <option value="0_{$v.id}" {eq name="$v.access_type" value="0"} selected{/eq}>全部开放</option>
                            <option value="1_{$v.id}" {eq name="$v.access_type" value="1"} selected{/eq}>登陆用户</option>
                            <option value="3_{$v.id}" {eq name="$v.access_type" value="3"} selected{/eq}>会员用户</option>
                            <option value="2_{$v.id}" {eq name="$v.access_type" value="2"} selected{/eq}>部分用户</option>
                        </select>
                    </td>
                    <td >
                        <a href="{:url('post/admin.post/editpost',['id'=>$v['id']])}" class="layui-btn layui-btn-xs">编辑</a>
                        <a href="{:url('post/admin.post/pdf',['id'=>$v['id']])}" class="layui-btn layui-btn-xs">PDF文件</a>
                        <a href="{:url('post/admin.post/word',['id'=>$v['id']])}" class="layui-btn layui-btn-xs">Word文件</a>
                        <button class="layui-btn layui-btn-xs push" type="button" data-href="{:url('post/admin.post/push',['id'=>$v.id])}">推送</button>
                    </td>
                </tr>
                {/volist}
                </tbody>
            </table>
            {$postList|raw}
        </form>
    </div>
</div>